//
//  WeiboAnnotation.m
//  weibo-01
//
//  Created by HZApple on 16/5/23.
//  Copyright © 2016年 hdu. All rights reserved.
//

#import "WeiboAnnotation.h"

@implementation WeiboAnnotation

- (void)setWeibo:(WeiboModel *)weibo {
    
    _weibo = weibo;
    
    
    //把weibo的GEO信息传递给annotation对象
    NSDictionary *geo = _weibo.geo;
    
    NSArray *geoArray = geo[@"coordinates"];
    
    NSLog(@"%li", geoArray.count);
    
    if (geoArray.count == 2) {
        
        NSString *lat = [geoArray firstObject];
        NSString *lon = [geoArray lastObject];
        
        self.coordinate = CLLocationCoordinate2DMake([lat floatValue], [lon floatValue]);
        
        
    }
    
}


@end
